﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="coupon.aspx.cs" Inherits="coupon" EnableViewState="false" %>
<!DOCTYPE html>
<html>
<head>
    <title>优惠券</title>
</head>
<body>
    <div>
        <section data-role="page" id="coupon_main">
        <div style="text-align:center;font-size:12px;display:none;" runat="server" id="msg"><img src="images/sc.png"  style="width:30%;margin-top:150px;"/><br/><span id="msgText" style="font-size:18px;color:#aaa;">暂无优惠券信息</span></div>
            <ul data-role="listview" id="coupon_content">
                <asp:Repeater runat="server" ID="rptCoupon" 
                    onitemdatabound="rptCoupon_ItemDataBound">
                    <ItemTemplate>
                        <li>
				            <a href="#">
                                <h3>优惠券名：<%#Eval("CouponTitle")%></h3>
                                <p>使用说明：<span runat="server" id="spCouponDesc"></span></p>
                                <p>有效期限：<span runat="server" id="spCouponTime" style="color:Red;"></span></p>
                                <p runat="server" id="pCouponNumber" style="color:Red;"></p>
                            </a>
                            <a runat="server" id="aCouponClick" data-icon="back">返回</a>
			            </li>
                    </ItemTemplate>
                </asp:Repeater>
                <a href="#index" data-role="button" data-theme="b" style="display:none;" id="goBack">返回首页</a>
            </ul>
            <a runat="server" id="aa"></a>


            <footer data-role="footer" data-position="fixed" id="coupon_footer">
                <div data-role="navbar" id="nav-glyphish-example">
                    <ul>
                        <li><a href="#index" id="A1"><img src="images/business_site_btn.png" /><br/>商家网站</a></li>
                        <li><a href="#" onclick="openshoplist()"><img src="images/Goods_Book_btn.png" /><br/>商品购买</a></li>
                        <li class="footer_active"><a href="#membershipcard" data-load="membershipcard.aspx" id="A3"><img src="images/03.png" /><br/>会员卡</a></li>
                        <li><a href="#giftlist" data-load="giftlist.aspx" id="A4" class="ui-btn-active"><img src="images/exchange_btn.png" /><br/>积分兑换</a></li>
                    </ul>
                </div>
            </footer>
            <script type="text/javascript">
                $("a[Coupon]").click(function () {
                    var ID = $(this).attr("Coupon");
                    $.get("../Service/AjaxService.ashx?Method=RequestCoupon", { "ID": ID, "MemID": getCookie("uid") }, function (text) {
                        if (text == "-1") { alert("该优惠券已发完，其他的也不错哟！"); }
                        else if (text == "0") { alert("系统有点繁忙，提交失败！"); }
                        else { alert("优惠券申请成功！"); $("#goBack").click(); }
                    }, "text")
                })
            </script>
        </section>
    </div>
</body>
</html>


